<template>
  <div>
    <div class="box" v-for="(item, index) in baseInfo" :key="index">
      <div class="title-scroll" :title="item.rightTitle">{{ item.rightTitle }}</div>
      <div class="title-scroll" :title="item.rightValue">{{ item.rightValue || '--' }}</div>
      <template v-if="item.leftTitle !== '经营者类型' && item.leftTitle !== '工商登记号'">
        <div class="title-scroll" :title="item.leftTitle">{{ item.leftTitle }}</div>
        <div class="title-scroll" :title="item.leftValue">{{ item.leftValue || '--' }}</div>
      </template>
    </div>
  </div>
</template>

<script>
export default {
  name: 'BaseInfo',
  props: {
    baseInfo: Array,
  },
  data() {
    return {}
  },
}
</script>

<style lang="scss" scoped>
.box {
  @include flex();
  flex-wrap: wrap;
  border-left: 1px solid $gray-lighter;
  border-top: 1px solid $gray-lighter;
  border-right: 1px solid $gray-lighter;
  &:last-child {
    border-bottom: 1px solid $gray-lighter;
  }

  > div {
    width: 25%;
    height: 40px;
    text-align: center;
    line-height: 40px;
    color: $gray;
    &:not(:nth-child(4n)) {
      border-right: 1px solid $gray-lighter;
    }
    &:first-child,
    &:nth-child(3) {
      background-color: #fafafa;
    }
  }
}
.title-scroll {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  -o-text-overflow: ellipsis;
}
</style>
